/**
 * 功能描述
 */
define(function (require, exports, module) {
    //引入视图基类
    var ELView = require("elview");
    var aw = require("ajaxwrapper");
    //assets
    var template = require("./assets/tpl/plancheckoutsettlement_main.tpl");
//    require("./assets/css/checkin_main.css");

    //business
    //component
    var pcsSubnavComp = require("./component/pcsSubnavComp");
    var pcsGridComp = require("./component/pcsGridComp");
    var onCreditForm = require("./component/onCreditForm");
    var cSettlementEditGridComp = require("../../checkoutsettlement/src/component/checkOutSettlementEditGridComp");
    var cSettlementEndGrid = require("../../checkoutsettlement/src/component/checkOutSettlementEndGrid");
    var cSettlementForm = require("../../checkoutsettlement/src/component/checkOutSettlementFormComp");
    var checkOutSettlementDetailForm = require("../../checkoutsettlement/src/component/checkOutSettlementDetailForm");
    var settleEditGridOne = require("../../checkoutsettlement/src/component/settleEditGridOne");
    var settleEditGridTwo = require("../../checkoutsettlement/src/component/settleEditGridTwo");
    var settleForm = require("../../checkoutsettlement/src/component/settleForm");
    var allianceSettlementFormComp = require("./component/allianceSettlementFormComp");
    var allianceSettlementEditGrid = require("./component/allianceSettlementEditGrid");
    var allianceSettlementEditGridComp = require("./component/allianceSettlementEditGridComp");
    
    //constant

    //handler
    var pcshandler = require("./handler/pcshandler");
    var handler = require("../../checkoutsettlement/src/handler/checkOutSettlementHandler");
    var alltotal = require("./handler/alltotal");
    var detailEvents = require("../../checkoutsettlement/src/handler/detailEvents");
    
    //store
    var checkinfile = require("./store/plancheckoutsettlementStore");
    var store = require("../../checkoutsettlement/src/store/checkOutSettle")
    
    var checkin_main = ELView.extend({
    	detail: true,
    	alltotal:alltotal,
        attrs: {
        	model:{},
            template: template
        },
        store: store,
        pcshandler: pcshandler,
        handler:handler,
        detailHandler:detailEvents,
        initComponent:function (params, widget) {
        	pcsSubnavComp.initComponent(params, widget);
        	pcsGridComp.initComponent(params, widget);
        	onCreditForm.initComponent(params, widget);
        	cSettlementEditGridComp.initComponent(params, widget);
        	cSettlementEndGrid.initComponent(params, widget);
        	cSettlementForm.initComponent(params, widget);
        	checkOutSettlementDetailForm.initComponent(params, widget);
        	settleEditGridOne.initComponent(params, widget);
        	settleEditGridTwo.initComponent(params, widget);
        	settleForm.initComponent(params, widget);
        	
        	allianceSettlementFormComp.initComponent(params, widget);
        	allianceSettlementEditGrid.initComponent(params, widget);
        	allianceSettlementEditGridComp.initComponent(params, widget);
        },
        afterInitComponent: function (params, widget) {
     		aw.ajax({
				url:"api/baseprice/getprice",
				dataType:"json",
				success:function(datas){
					widget.set("basePrice",datas);
					widget.get("grid").refresh();
				}
 			})
     		
        }
    });

    module.exports = checkin_main;
});
